package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 微信用户授权记录对象 sys_wechat_auth
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
public class SysWechatAuth extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 微信OpenID */
    @Excel(name = "微信OpenID")
    private String openid;

    /** 微信UnionID */
    @Excel(name = "微信UnionID")
    private String unionid;

    /** 微信会话密钥 */
    private String sessionKey;

    /** 微信访问令牌 */
    private String accessToken;

    /** 微信刷新令牌 */
    private String refreshToken;

    /** 令牌过期时间（秒） */
    @Excel(name = "令牌过期时间")
    private Integer expiresIn;

    /** 授权范围 */
    @Excel(name = "授权范围")
    private String scope;

    /** 关联用户ID */
    @Excel(name = "关联用户ID")
    private Long userId;

    /** 授权时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "授权时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date authTime;

    /** 最后授权时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后授权时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastAuthTime;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setOpenid(String openid) 
    {
        this.openid = openid;
    }

    public String getOpenid() 
    {
        return openid;
    }
    public void setUnionid(String unionid) 
    {
        this.unionid = unionid;
    }

    public String getUnionid() 
    {
        return unionid;
    }
    public void setSessionKey(String sessionKey) 
    {
        this.sessionKey = sessionKey;
    }

    public String getSessionKey() 
    {
        return sessionKey;
    }
    public void setAccessToken(String accessToken) 
    {
        this.accessToken = accessToken;
    }

    public String getAccessToken() 
    {
        return accessToken;
    }
    public void setRefreshToken(String refreshToken) 
    {
        this.refreshToken = refreshToken;
    }

    public String getRefreshToken() 
    {
        return refreshToken;
    }
    public void setExpiresIn(Integer expiresIn) 
    {
        this.expiresIn = expiresIn;
    }

    public Integer getExpiresIn() 
    {
        return expiresIn;
    }
    public void setScope(String scope) 
    {
        this.scope = scope;
    }

    public String getScope() 
    {
        return scope;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setAuthTime(Date authTime) 
    {
        this.authTime = authTime;
    }

    public Date getAuthTime() 
    {
        return authTime;
    }
    public void setLastAuthTime(Date lastAuthTime) 
    {
        this.lastAuthTime = lastAuthTime;
    }

    public Date getLastAuthTime() 
    {
        return lastAuthTime;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("openid", getOpenid())
            .append("unionid", getUnionid())
            .append("sessionKey", getSessionKey())
            .append("accessToken", getAccessToken())
            .append("refreshToken", getRefreshToken())
            .append("expiresIn", getExpiresIn())
            .append("scope", getScope())
            .append("userId", getUserId())
            .append("authTime", getAuthTime())
            .append("lastAuthTime", getLastAuthTime())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
